package com.hx78;

public class Test {
    private static Test test = new Test();
    private Test(){}
    public static Test getInstant() {
        return test;
    }

    //在一个字符串中找到第一个只出现一次的字符。如输入abaccdeff，则输出b
    public static String getChar(String str) {
        for (int i = 0 ; i < str.length(); i++) {
            String s  = str.substring(i, i+1);
            String[] strArr = str.split(s);
            if(strArr.length == 2) {
                return s;
            }
        }
        return null;
    }

    public static void main(String[] args) {
        System.out.println(getChar("abaccdeff"));
    }
}
